package com.dht.xiao.jianye.command.base.exception;

/**
 * @author :      fangbingran
 * @aescription : todo(这里用一句话描述这个类的作用)
 * @date :        2019/06/06  10:48
 */
public class ApiException extends RuntimeException {
    /**
     * 用String，若是int转下就是
     */
    private final String code;

    public ApiException(String code, String message) {
        super(message);
        this.code = code;
    }

    public ApiException(String code, Throwable message) {
        super(message);
        this.code = code;
    }

    /**
     * 异常码
     */
    public String getCode() {
        return code;
    }

    @Override
    public String toString() {
        return "ApiException{" +
                "code='" + code + '\'' + ",message='" + getMessage() + '\'' +
                '}';
    }
}

